package cz.worsik.android.test.rideshare.constants;

import android.content.res.Resources;

import java.util.ArrayList;
import java.util.List;

import cz.worsik.android.test.rideshare.R;
import cz.worsik.android.test.rideshare.model.DrawerItem;
import cz.worsik.android.test.rideshare.model.Route;
import cz.worsik.android.test.rideshare.model.RouteSpinnerItem;
import cz.worsik.android.test.rideshare.model.list.ERouteType;

/**
 * Created by 231260 on 30.5.14.
 */
public class InitConst {

    public static ArrayList<DrawerItem> makeDrawerItems(Resources resources) {
        ArrayList<DrawerItem> items = new ArrayList<DrawerItem>();

        // titulek trasy
        items.add(new DrawerItem(EMenuItem.TITLE_SPINNER, resources));
        // spinner trasy
        items.add(new DrawerItem(EMenuItem.SPINNER_ROUTE, resources));
        // titulek menu
        items.add(new DrawerItem(EMenuItem.TITLE_MENU, resources));
        // menu
        items.add(new DrawerItem(EMenuItem.MENU_DRIVEWAYS, resources));
        items.add(new DrawerItem(EMenuItem.MENU_PAYMENTS, resources));
        items.add(new DrawerItem(EMenuItem.MENU_CONTACTS, resources));
        items.add(new DrawerItem(EMenuItem.MENU_EXIT, resources));

        return items;
    }

    public static ArrayList<DrawerItem> makeDrawerMenuItems(Resources resources) {
        ArrayList<DrawerItem> items = new ArrayList<DrawerItem>();

        // menu
        items.add(new DrawerItem(EMenuItem.MENU_DRIVEWAYS, resources));
        items.add(new DrawerItem(EMenuItem.MENU_PAYMENTS, resources));
        items.add(new DrawerItem(EMenuItem.MENU_CONTACTS, resources));
        items.add(new DrawerItem(EMenuItem.MENU_EXIT, resources));

        return items;
    }

    public static List<RouteSpinnerItem> getRouteListForSpinner(Resources res) {
        List<RouteSpinnerItem> list = new ArrayList<RouteSpinnerItem>();
        for (Route r : InitConst.getRouteList(res))
        {
            list.add(new RouteSpinnerItem(r));
        }

        return list;
    }

    public static List<Route> getRouteList(Resources res) {
        List<Route> list = new ArrayList<Route>();

        list.add(new Route("Opava - Ostrava", ERouteType.SIMPLE));
        list.add(new Route("Opava - Vítkov", ERouteType.CLASSIC));
        list.add(new Route("Krnov - Opava", ERouteType.TAXI));

        list.add(new Route(res.getString(R.string.new_route_name), ERouteType.NEW));

        return list;
    }
}
